﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace Lilium.Web.Mvc
{
    /*
	public static class ViewPageExtensions
	{
		public static TInstance GetInstance<TInstance>(this ViewPage viewPage)
		{
			if (viewPage == null) throw new ArgumentNullException("viewPage");

			return viewPage.ViewData.GetInstance<TInstance>();
		}

        public static TInstance GetInstance<TInstance>(this ViewPage viewPage, string name)
        {
            if (viewPage == null) throw new ArgumentNullException("viewPage");

            return viewPage.ViewData.GetInstance<TInstance>(name);
        }

		public static TService GetService<TService>(this ViewPage viewPage, bool required)
		{
			if (viewPage == null) throw new ArgumentNullException("viewPage");

			var serviceProvider = viewPage.Html.ViewContext.Controller.GetServiceProvider();
			return serviceProvider.GetService<TService>(required);
		}
	}
     */
}